import { $axios } from "../http/request";

// 注册新用户
export const reguserRequest = (data) => {
  return $axios({
    url: '/api/reguser',
    method: 'post',
    data
  })
}

// 登录
export const loginRequest = (data) => {
  return $axios({
    url: '/api/login',
    method: 'post',
    data
  })
}

// 获取用户的基本信息
export const userinfoRequest = () => {
  return $axios({
    url: '/my/userinfo',
    method: 'get',
  })
}

// 更新用户的基本信息
export const updateUserinfoRequest = (data) => {
  return $axios({
    url: '/my/userinfo',
    method: 'post',
    data
  })
}

// 更换头像
export const setHeadPortraitRequest = (data) => {
  return $axios({
    url: '/my/update/avatar',
    method: 'post',
    data
  })
}

// 重置密码
export const updatepwdRequset = (data) => {
  return $axios({
    url: '/my/updatepwd',
    method: 'post',
    data
  })
}